package com.kingwang.training.ooad.coffeemaker.badway;

import com.kingwang.training.ooad.coffeemaker.hardware.api.CoffeeMakerApi;
import com.kingwang.training.ooad.coffeemaker.hardware.api.IndicatorState;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 指示灯
 *
 * @author King
 */
@Component
public class Light {
    @Resource
    private CoffeeMakerApi coffeeMakerApi;

    public void on() {
        this.coffeeMakerApi.setIndecatorState(IndicatorState.ON);
    }

    public void off() {
        this.coffeeMakerApi.setIndecatorState(IndicatorState.OFF);
    }
}
